var http = require('http');
var url = require('url');
var fs = require('fs');

http.createServer(function(request, response) {
  response.writeHead(200, {
    'Content-Type': 'text/html'
  });
  var pathname = url.parse(request.url).pathname;
  var html = '';

  fs.readFile(pathname.substr(1), (err, data) => {
    if (err)
      console.log(err.stack);
    html = data;
    console.log(html);
    response.write(html);
    response.end();

  })
}).listen(8888);
console.log('Start Server ：127.0.0.1:8888');
